{% load staticfiles %}
{% load i18n %}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
    <link type="text/css" rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" />
    <link type="text/css" rel="stylesheet" href="{% static 'css/flags.css' %}" />
    <link type="text/css" rel="stylesheet" href="{% static 'css/base.css' %}" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap.min.js' %}"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var localForm = $('#localize');
            localForm.find('a').click(function(event){
                event.preventDefault();
                localForm.find('input[name="language"]').val($(this).attr('href'));
                localForm.submit();
            });
        });
    </script>
    {% block stylesheets %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{% url 'home:home_home' %}">{% trans 'Піст і молитва' %}</a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="#">{% trans "Здоров'я" %}</a></li>
                    <li><a href="#">{% trans 'Золоті істини' %}</a></li>
                    <li><a href="#">{% trans 'Семінари' %}</a></li>
                    <li><a href="#">{% trans 'Про проект' %}</a></li>
                </ul>
            </div>
        </div>
    </nav>
    <div class="container-fluid" style="padding-top:70px;">
        {% block body %}{% endblock %}
    </div>
    <hr class="featurette-divider">
    <footer>
        <div class="container-fluid">
            <p class="pull-left">
                © 2015 Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a>
            </p>
            <form id="localize" method="post" action="{% url 'set_language' %}">
                <input name="next" type="hidden" value="{{ redirect_to }}" />
                <input name="language" type="hidden" />
                {% get_language_info_list for LANGUAGES as languages %}
                {% for language in languages %}
                    <a href="{{ language.code }}" {% if language.code == LANGUAGE_CODE %} class="active"{% endif %} onclick="localize(this);">
                        <img class="flag flag-{{ language.code }}" />
                        {{ language.name_local }}
                    </a>
                {% endfor %}
            </form>
        </div>
    </footer>
    {% block javascripts %}{% endblock %}
</body>
</html>